ScrolledWindow: Annotate h|vadjustment as nullable
authorDaniel Boles <dboles.src@gmail.com>
Tue, 21 May 2019 19:26:49 +0000 (20:26 +0100)
committerDaniel Boles <dboles.src@gmail.com>
Tue, 21 May 2019 20:21:14 +0000 (21:21 +0100)
The code interprets NULL to mean 'create a new Adjustment and use that,
deposing the old one', but we neither documented nor annotated that
ability, so users could be unsure how to "unlink" a specific Adjustment.
While users could pass their own Adjustment in if this wasn't nullable,
we already support NULL in the code, and it doesn't hurt to document
that this is available as a convenience while retaining the behaviour.

gtk/gtkscrolledwindow.c

index 1a1c03b4ae25a04698ed83dd4f6cf66ecee989c3..1a87169b714f4d23b9c0830e6f935afedce84ae3 100644 (file)
@@ -2032,7 +2032,7 @@ gtk_scrolled_window_new (GtkAdjustment *hadjustment,
 /**
  * gtk_scrolled_window_set_hadjustment:
  * @scrolled_window: a #GtkScrolledWindow
- * @hadjustment: horizontal scroll adjustment
+ * @hadjustment: (nullable): the #GtkAdjustment to use, or %NULL to create a new one
  *
  * Sets the #GtkAdjustment for the horizontal scrollbar.
  */
@@ -2106,7 +2106,7 @@ gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window,
 /**
  * gtk_scrolled_window_set_vadjustment:
  * @scrolled_window: a #GtkScrolledWindow
- * @vadjustment: vertical scroll adjustment
+ * @vadjustment: (nullable): the #GtkAdjustment to use, or %NULL to create a new one
  *
  * Sets the #GtkAdjustment for the vertical scrollbar.
  */